package com.itheima.web;

import com.itheima.service.UserService;

/**
 * @Author itheima
 * @Date 2022/4/23 10:10
 */
public class UserServlet {
    //问题：给成员变量赋值存在耦合性
    //private UserService userService = new UserServiceImpl();
    private UserService userService;

    public UserServlet() {
        System.out.println("UserServlet.UserServlet");
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public void save() {
        userService.save();
        System.out.println("UserServlet.save");
    }
}
